# Contributor: Miguel Terron <miguel.a.terron@gmail.com>
# Maintainer: Miguel Terron <miguel.a.terron@gmail.com>
pkgname=mdnsd
pkgver=0.12
pkgrel=1
pkgdesc="Embeddable Multicast DNS Daemon"
url="https://github.com/troglobit/mdnsd"
arch="all"
license="BSD-3-Clause"
subpackages="
	$pkgname-doc
	$pkgname-libs
	$pkgname-static
	$pkgname-openrc
	"
source="
	mdnsd.confd
	mdnsd.initd
	https://github.com/troglobit/mdnsd/releases/download/v$pkgver/mdnsd-$pkgver.tar.xz
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--without-systemd
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="
417c394b24ee1ac87f83a6040df963e948191007ef9b27b28537ecdf7b01e126b0069f6ef96e579394d75b90194f1de975edb9e71486e16815372ea379006601  mdnsd.confd
8a4fb736263ec05aa439f320091a43dfea64fb7e89fd0af5ada3981d0461009f55e1ac598a143a9458063eaf117e1b7b788463f0af316153fa6bfea864019a99  mdnsd.initd
c28917bfb16f1fa6d3594a4e98f43cae7cc5bfcb31dac6bc8eeafae60e05b15790245d859137e0c15838893f04365c2a48331b6082fa5b17ff5ae3665c963de6  mdnsd-0.12.tar.xz
"
